import Home from '@/pages/Home/Home.vue'
import Login from '@/pages/Login'
import Register from '@/pages/Register'
import Search from '@/pages/Search/Search.vue'
import Detail from '@/pages/Detail'
import AddCartSuccess from '@/pages/AddCartSuccess'
import ShopCart from '@/pages/ShopCart'
import trade from '@/pages/Trade'

export default [
    {
        path: "/center",
        component: () => import("@/pages/Center"),
        meta: {
            show: true
        },
        children: [
            {
                path: 'grouporder',
                component: () => import('@/pages/Center/groupOrder')
            },
            {
                path: 'myorder',
                component: () => import('@/pages/Center/myOrder')
            },
            {
                path: '/center',
                redirect: '/center/myorder'
            }
        ]
    },
    {
        path: "/paysuccess",
        component: () => import("@/pages/PaySuccess"),
        meta: {
            show: true
        }
    },
    {
        path: "/pay",
        component: () => import('@/pages/Pay'),
        meta: {
            show: true
        }
    },
    {
        path: '/trade',
        component: trade,
        meta: {
            show: true
        }
    },
    {
        path: '/shopcart',
        component: ShopCart,
        meta: {
            show: true
        }
    },
    {
        path: '/addcartsuccess',
        component: AddCartSuccess,
        meta: {
            show: true
        }
    },
    {
        path: '/detail/:skuid',
        component: Detail,
        meta: {
            show: true
        }
    },
    {
        path: '/home',
        component: Home,
        meta: {
            show: true
        }
    },
    {
        path: '/login',
        component: Login,
        meta: {
            show: false
        }
    },
    {
        path: '/register',
        component: Register,
        meta: {
            show: false
        }
    },
    {
        name: 'search',
        path: '/search/:keyword?',
        component: Search,
        meta: {
            show: true
        }
    },
    {
        path: '*',
        redirect: '/home'
    }
]
